package com.ruoyi.operator.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.operator.mapper.OptMemberOrderDetailMapper;
import com.ruoyi.operator.domain.OptMemberOrderDetail;
import com.ruoyi.operator.service.IOptMemberOrderDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会员收支记录详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-27
 */
@Service
public class OptMemberOrderDetailServiceImpl implements IOptMemberOrderDetailService 
{
    @Autowired
    private OptMemberOrderDetailMapper optMemberOrderDetailMapper;

    /**
     * 查询会员收支记录详情
     * 
     * @param id 会员收支记录详情ID
     * @return 会员收支记录详情
     */
    @Override
    public OptMemberOrderDetail selectOptMemberOrderDetailById(Long id)
    {
        return optMemberOrderDetailMapper.selectOptMemberOrderDetailById(id);
    }

    /**
     * 查询会员收支记录详情列表
     * 
     * @param optMemberOrderDetail 会员收支记录详情
     * @return 会员收支记录详情
     */
    @Override
    public List<OptMemberOrderDetail> selectOptMemberOrderDetailList(OptMemberOrderDetail optMemberOrderDetail)
    {
        return optMemberOrderDetailMapper.selectOptMemberOrderDetailList(optMemberOrderDetail);
    }

    /**
     * 新增会员收支记录详情
     * 
     * @param optMemberOrderDetail 会员收支记录详情
     * @return 结果
     */
    @Override
    public int insertOptMemberOrderDetail(OptMemberOrderDetail optMemberOrderDetail)
    {
        optMemberOrderDetail.setCreateTime(DateUtils.getNowDate());
        return optMemberOrderDetailMapper.insertOptMemberOrderDetail(optMemberOrderDetail);
    }

    /**
     * 修改会员收支记录详情
     * 
     * @param optMemberOrderDetail 会员收支记录详情
     * @return 结果
     */
    @Override
    public int updateOptMemberOrderDetail(OptMemberOrderDetail optMemberOrderDetail)
    {
        optMemberOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return optMemberOrderDetailMapper.updateOptMemberOrderDetail(optMemberOrderDetail);
    }

    /**
     * 删除会员收支记录详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteOptMemberOrderDetailByIds(String ids)
    {
        return optMemberOrderDetailMapper.deleteOptMemberOrderDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员收支记录详情信息
     * 
     * @param id 会员收支记录详情ID
     * @return 结果
     */
    @Override
    public int deleteOptMemberOrderDetailById(Long id)
    {
        return optMemberOrderDetailMapper.deleteOptMemberOrderDetailById(id);
    }
}
